package com.recharge.shiro;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator;
import org.apache.shiro.session.mgt.eis.SessionIdGenerator;

import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ShiroSessionIdGenerator implements SessionIdGenerator {

    private Logger logger = LoggerFactory.getLogger(this.getClass().getName());

    @Override
    public Serializable generateId(Session session) {
        Serializable uuid = new JavaUuidSessionIdGenerator().generateId(session);
        logger.debug("生成的sessionid是："+uuid);
        return uuid;
    }

}
